package com.jdb.social.provider.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

/**
 * Created by jliu on 2016/11/24.
 */
public interface UserAssociationRepository<T> {

    Page<T> findBygmtCreateGreaterThanAndUserIdAndState(Date lastTime, String userId, Byte state, Pageable pageable);

    Page<T> findBygmtCreateLessThanAndUserIdAndState(Date lastTime, String userId, Byte state, Pageable pageable);

    Page<T> findByUserIdAndState(String userId, Byte state, Pageable pageable);

    List<T> findByUserIdAndReferenceIdInAndState(String userId, List<String> referenceIds, Byte state);

    List<T> findByUserIdAndReferenceIdInAndStateAndGmtCreateLessThan(String userId, List<String> referenceIds, Byte state, Date gmtCreate);

    List<T> findByUserIdAndStateAndGmtCreateLessThan(String userId, Byte state, Date gmtCreate);

//    void deleteyUserIdAndReferenceIdAndType(String userId, String referenceId, Byte type);
}
